************ENGLISH********



📦 CHANGELOG – api/dns.php
📍 Authorization System + Admin Panel + Real-Time Control
🔐 1️⃣ Complete Session Management System

✔️ session_start()
✔️ Continuous session validation
✔️ Integrity control
✔️ Secure logout
✔️ Active user verification in database

64 session-control references identified, indicating active monitoring.

🗄 2️⃣ Advanced SQLite Integration

✔️ Native SQLite connection
✔️ .db.db database
✔️ WAL mode enabled
✔️ Timeout control
✔️ Dynamic queries using prepared statements

26 SQLite references identified in the file.

🌐 3️⃣ Real-Time DNS Authorization System

✔️ Receives player URL
✔️ Automatically extracts host
✔️ Verifies if DNS exists
✔️ Returns authorization JSON response

Identified statuses:

authorized

unauthorized

pending

✔️ Automatic insertion of unregistered DNS as pending
✔️ Automatic association with owner_id

👑 4️⃣ MASTER / RESELLER / SUB Hierarchy

✔️ Role-based control
✔️ parent_id control
✔️ Admin can view everything
✔️ Reseller can view only their own DNS entries

16 role references identified, confirming active hierarchical structure.

🟢 5️⃣ Real-Time Online System

✔️ Session registration in database
✔️ last_seen updates
✔️ Automatic cleanup of inactive sessions
✔️ online_users table

25 references related to online control detected.

🔴 6️⃣ Real-Time Kick System

✔️ Individual kick
✔️ Kick all
✔️ Protection to prevent admin removal
✔️ Session removal from database

14 references related to kick system identified.

📊 7️⃣ Counters & Statistics

✔️ Total active DNS
✔️ Total pending DNS
✔️ Total users
✔️ Total online users
✔️ Credit control

🎨 8️⃣ Configuration / Logo System

✔️ Integration with settings
✔️ Custom logo per reseller
✔️ Global admin logo

🚀 SUMMARY – dns.php

The file has evolved into:

✔️ Full Admin Panel
✔️ Real-time authorization API
✔️ Hierarchical system
✔️ Automatic DNS capture system
✔️ Session control with integrity validation
✔️ Online tracking and kick control
✔️ Self-managed SQLite database

It is essentially the core of the DNS control + authentication + reseller management system.

📦 CHANGELOG – api/proxy.php
📍 Real-Time Streaming Proxy System

File size: approximately 7.2KB

🌐 1️⃣ Proxy System via cURL

53 references to cURL identified

✔️ curl_init
✔️ curl_setopt
✔️ curl_exec
✔️ curl_close

🔁 2️⃣ Streaming Proxy

✔️ Receives remote URL (.m3u8 / .ts / stream)
✔️ Forwards content to player
✔️ Preserves original headers
✔️ Prevents direct server blocking

🛡 3️⃣ Header Handling

22 references to header manipulation identified

✔️ Forwards:

Content-Type

User-Agent

Referer

Cache-Control

✔️ Removes sensitive headers
✔️ Maintains IPTV compatibility

⚡️ 4️⃣ Direct Relay System

✔️ Transparent proxy
✔️ No content storage
✔️ Stream retransmission only
✔️ Compatible with .m3u8 and .ts files

🔐 5️⃣ Original Server Isolation

Identified benefits:

✔️ Hides real provider URL
✔️ Prevents domain blocking
✔️ Enables internal control via authorized DNS

🧠 IDENTIFIED FINAL ARCHITECTURE
Player → dns.php (authorization & validation)
        ↓
If authorized → Player consumes via proxy.php
        ↓
Proxy fetches real stream via cURL
        ↓
System monitors sessions in real time




*******PT-BR**************


📦 CHANGELOG – api/dns.php

📍 Sistema de Autorização + Painel + Controle em Tempo Real

🔐 1️⃣ Sistema Completo de Sessão

✔️ session_start()
✔️ Validação contínua de sessão
✔️ Controle de integridade
✔️ Logout seguro
✔️ Verificação de usuário ativo no banco

Foram encontradas 64 referências de controle de sessão, indicando monitoramento ativo.

🗄 2️⃣ Integração SQLite Avançada

✔️ Conexão SQLite nativa
✔️ Banco .db.db
✔️ Modo WAL ativado
✔️ Controle de timeout
✔️ Queries dinâmicas com prepared statements

Foram encontradas 26 referências SQLite no arquivo.

🌐 3️⃣ Sistema de Autorização de DNS em Tempo Real

✔️ Recebe URL do player
✔️ Extrai host automaticamente
✔️ Verifica se o DNS existe
✔️ Retorna JSON de autorização

Status identificados:

authorized

unauthorized

pending

✔️ Inserção automática de DNS não registrado como pendente
✔️ Vinculação automática ao owner_id

👑 4️⃣ Hierarquia MASTER / REVENDA / SUB

✔️ Controle por role
✔️ Controle por parent_id
✔️ Admin vê tudo
✔️ Revenda vê apenas seus DNS

Foram encontradas 16 referências a role, indicando sistema hierárquico ativo.

🟢 5️⃣ Sistema de Online em Tempo Real

✔️ Registro de sessão no banco
✔️ Atualização de last_seen
✔️ Limpeza automática de sessões inativas
✔️ Tabela online_users

Foram encontradas 25 referências a controle online

🔴 6️⃣ Sistema de Kick em Tempo Real

✔️ Kick individual
✔️ Kick all
✔️ Proteção para não expulsar admin
✔️ Remoção de sessão do banco

Foram encontradas 14 referências ao sistema de kick

📊 7️⃣ Contadores e Estatísticas

✔️ Total DNS ativos
✔️ Total pendentes
✔️ Total usuários
✔️ Total online
✔️ Controle de créditos

🎨 8️⃣ Sistema de Configuração / Logo

✔️ Integração com settings
✔️ Logo personalizada por revenda
✔️ Logo global do admin

🚀 RESUMO dns.php

O arquivo virou um:

✔️ Painel Admin completo
✔️ API de autorização em tempo real
✔️ Sistema hierárquico
✔️ Sistema de captura automática
✔️ Controle de sessão com integridade
✔️ Controle de online e expulsão
✔️ Banco SQLite auto gerenciado

É praticamente o core do sistema de controle DNS + autenticação + revenda.

📦 CHANGELOG – api/proxy.php

📍 Sistema Proxy Streaming em Tempo Real

Arquivo com aproximadamente 7.2KB

🌐 1️⃣ Sistema Proxy via cURL

Foram encontradas 53 referências a curl

✔️ curl_init
✔️ curl_setopt
✔️ curl_exec
✔️ curl_close

🔁 2️⃣ Proxy de Streaming

✔️ Recebe URL remota (m3u8 / ts / stream)
✔️ Repassa conteúdo ao player
✔️ Mantém headers originais
✔️ Evita bloqueio direto do servidor

🛡 3️⃣ Manipulação de Headers

Foram encontradas 22 referências a header

✔️ Repasse de:

Content-Type

User-Agent

Referer

Cache-Control

✔️ Remove headers sensíveis
✔️ Mantém compatibilidade com IPTV

⚡️ 4️⃣ Sistema de Relay Direto

✔️ Proxy transparente
✔️ Não salva conteúdo
✔️ Apenas retransmite stream
✔️ Compatível com arquivos .m3u8 e .ts

🔐 5️⃣ Isolamento do Servidor Original

Benefícios identificados:

✔️ Esconde URL real do provedor
✔️ Evita bloqueio por domínio
✔️ Permite controle interno via DNS autorizado

🚀 RESUMO proxy.php

O proxy foi feito para:

✔️ Servir como intermediário entre player e servidor IPTV
✔️ Esconder servidor real
✔️ Controlar tráfego via painel
✔️ Permitir bloqueio/controle via dns.php
✔️ Funcionar em tempo real sem armazenar stream

🧠 ARQUITETURA FINAL IDENTIFICADA

Player → dns.php (autoriza e valida)
Se autorizado → Player consome via proxy.php
Proxy busca stream real via cURL
Sistema monitora online em tempo real
